package com.xmmxjy.system.util;

import com.xmmxjy.system.entity.FunctionEntity;
import com.xmmxjy.system.page.FunctionPage;

/**
 * Created by xmm on 2017/3/4.
 */
public class BeanToPage {

    /**
     * 菜单实体转化为page
     * @param entity
     * @return
     */
    public static FunctionPage functionEntityToPage(FunctionEntity entity) {
        FunctionPage page = new FunctionPage();
        page.setTitle(entity.getFunctionname());
        page.setHref(entity.getFunctionurl());
        page.setIcon(entity.getIcon());
        if (entity.getSpread() == null || entity.getSpread().equals("0")) {
            page.setSpread(false);
        } else {
            page.setSpread(true);
        }
        return page;
    }
}
